package com.wangyadong.hobby.thread.atomic;

import sun.misc.Unsafe;

import java.math.BigDecimal;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.DoubleAccumulator;

public class DoubleAccumulatorTest {

    private static final Unsafe unsafe = Unsafe.getUnsafe();

    public static void main(String[] args) {

//        DoubleAccumulator d=new DoubleAccumulator(2.3D);
        AtomicInteger atomicInteger = new AtomicInteger();
//        int i = atomicInteger.incrementAndGet();
        int andIncrement = atomicInteger.getAndIncrement();
        System.out.println(andIncrement);

        andIncrement = atomicInteger.getAndIncrement();
        System.out.println(andIncrement);

//        unsafe.compareAndSwapInt(this,0,1,2);
    }
}
